Spot Instances
💡 Definition
Amazon EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS cloud. Spot Instances are available at up to a 90% discount compared to On-Demand prices.
🔑 Key Concepts
- Spare Capacity: You are bidding on unused AWS server capacity.
- Interruption: AWS can terminate your Spot Instance with a 2-minute warning if they need the capacity back.
- Price: The Spot price fluctuates based on supply and demand (but you never pay more than your max price).
⚙️ How it Works
- Request: You request Spot capacity, specifying a max price you are willing to pay.
- Launch: If your price > current Spot price, your instance launches.
- Run: It runs as long as capacity is available and your price > Spot price.
- Interrupt: If AWS needs capacity, you get a 2-minute warning via instance metadata/EventBridge to save work/hibernate.
🎯 Use Cases
- Fault-Tolerant Workloads: Batch processing, big data analysis, CI/CD pipelines.
- Stateless Web Servers: Behind a load balancer where losing a node is acceptable.
- Testing/Development: Running large scale tests cheaply.
💰 Pricing Model
- Market Price: You pay the current Spot price (which updates every 5 mins).
- Massive Discount: Up to 90% off On-Demand.
📝 Exam Tips (CLF-C02)
- Key characteristic: Can be interrupted.
- Use for stateless, fault-tolerant, flexible applications.
- Not for critical databases or applications that cannot handle downtime.
- Spot Block: (Deprecated feature, but concept remains) Requesting for a fixed duration (1-6 hours) without interruption is no longer the standard way; standard Spot is now the focus.
See Also: * EC2 * Auto Scaling